const http = uni.$u.http

// 注册
export const register = (data) => {
	return http.post('', {
		serviceName: 'HysqCustomerService',
		methodName: 'register',
		bizParams: {
			...data
		}
	})
}
// 登陆
export const login = (data) => {
	return http.post('', {
		serviceName: 'HysqCustomerService',
		methodName: 'login',
		bizParams: {
			...data
		}
	})
}
// 获取首页文章 列表
export const articleList = (data) => {
	// 页数
	let { pageNum } = data
	console.log(data, 'data')
	return http.post('', {
		serviceName: 'HysqArticleService',
		methodName: 'getArticlePageList',
		bizParams: {
			...data
		},
		pagination: {
			pageNum,
			pageSize: 5
		}
	})
}
// 根据文章ID首页文章详情
export const articleDetail = (data) => {
	return http.post('', {
		serviceName: 'HysqArticleService',
		methodName: 'getArticleDetails',
		bizParams: {
			...data
		}
	})
}
// 获取任务列表
export const taskList = (data) => {
	return http.post('', {
		serviceName: 'HysqTaskService',
		methodName: 'getTaskList',
		bizParams: {
			...data
		},
		pagination: {
			pageNum: 1,
			pageSize: 5
		}
	})
}
// 获取任务详情
export const taskDetail = (data) => {
	return http.post('', {
		serviceName: 'HysqTaskService',
		methodName: 'getTaskDetails',
		bizParams: {
			...data
		}
	})
}
// 领取任务
export const claimTask = (data) => {
	return http.post('', {
		serviceName: 'HysqTaskService',
		methodName: 'claimTask',
		bizParams: {
			...data
		}
	})
}
// 开通钱包
export const createWallet = (data) => {
	return http.post('', {
		serviceName: 'HysqAccountService',
		methodName: 'createWallet',
		bizParams: {
			...data
		}
	})
}
// 查看账户详情
export const getWalletDetail = (data) => {
	return http.post('', {
		serviceName: 'HysqAccountService',
		methodName: 'getWalletDetail',
		bizParams: {
			...data
		}
	})
}
// 充值
export const toRecharge = (data) => {
	return http.post('', {
		serviceName: 'HysqAccountService',
		methodName: 'recharge',
		bizParams: {
			...data
		}
	})
}
// 转账
export const toTransfer = (data) => {
	return http.post('', {
		serviceName: 'HysqAccountService',
		methodName: 'transfer',
		bizParams: {
			...data
		}
	})
}
// 我的任务
export const myTask = (data) => {
	return http.post('', {
		serviceName: 'HysqTaskService',
		methodName: 'getClaimedTasks',
		bizParams: {
			...data
		}
	})
}
